package com.cty.pojo;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Past;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.util.Date;

@Data
public class User {
    //参数校验注解
    @NotBlank
    private String name;//字符串不能为空

    @Length(min = 6)
    private String password;//密码最低六位

    @Min(1)
    private int age;//年龄最小1

    @Email
    private String email;//电子邮件格式

    @Past
    private Date birthday;//过去的日期

}
